package com.xqboss.apps.task;

import com.xqboss.apps.service.game.GameService;
import com.xqboss.system.domain.SysConfig;
import com.xqboss.system.mapper.SysConfigMapper;
import com.xqboss.system.service.ISysConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 转卖次数重置任务
 */
@Component("gameTask")
public class GameTask {

    @Autowired
    private GameService gameService;

    /**
     * 开启游戏
     *
     * 如果不传游戏id，则开启所有游戏，否则开启指定游戏
     */
    public void gameOpen(Long gameId){
        this.gameService.operateStatus(gameId, 1);
    }

    /**
     * 关闭游戏
     *
     * 如果不传游戏id，则关闭所有游戏，否则关闭指定游戏
     */
    public void gameClose(Long gameId){
        this.gameService.operateStatus(gameId, 0);
    }



}
